import React,{Component} from 'react';
import {inject, observer} from 'mobx-react';
import { Comment } from 'weaver-mobile-page';
const jQuery = window.jQuery;
@inject('wfSignListStore')
@observer
export default class CommentList extends Component {

  //打开评论中的附件流程
  operateAttachList = (type, data) => {
    window.openLink(data.url);
  }

  render() {
    const { signCommentStoreMap} = this.props.wfSignListStore;
    const { signId } = this.props;
    let signCommentStore = null;
    if(signCommentStoreMap.has(Number(signId))) {
      signCommentStore = signCommentStoreMap.get(Number(signId));
    }
    return (
      <div className='comment-list-wrap'>
        <Comment
          showAvatar={false}
          store={signCommentStore}
          operateAttachList={this.operateAttachList}
        />
    </div>
    )
  }
}